package com.meeting.manager.home;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import butterknife.Bind;
import butterknife.ButterKnife;

import com.meeting.manager.R;
import com.meeting.manager.me.AboutActivity;
import com.meeting.manager.me.ContactServiceActivity;
import com.meeting.manager.me.FriendsActivity;
import com.meeting.manager.me.PersonInfoActivity;
import com.meeting.manager.me.SuggestActivity;

public class MeFrament extends Fragment implements OnClickListener {
	private View view;
	@Bind(R.id.lay_about)
	RelativeLayout layAbout;
	@Bind(R.id.lay_friends)
	RelativeLayout layFriends;
	@Bind(R.id.lay_suggest)
	RelativeLayout laySuggest;
	@Bind(R.id.lay_contact)
	RelativeLayout layContact;
	@Bind(R.id.lay_name)
	RelativeLayout layName;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		view = inflater.inflate(R.layout.frament_me, null);
		ButterKnife.bind(this, view);
		initWidget();
		return view;
	}

	private void initWidget() {
		layAbout.setOnClickListener(this);
		laySuggest.setOnClickListener(this);
		layFriends.setOnClickListener(this);
		layContact.setOnClickListener(this);
		layName.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent = null;
		switch (v.getId()) {
		case R.id.lay_about:
			intent = new Intent(getActivity(), AboutActivity.class);
			startActivity(intent);
			break;
		case R.id.lay_friends:
			intent = new Intent(getActivity(), FriendsActivity.class);
			startActivity(intent);
			break;
		case R.id.lay_contact:
			intent = new Intent(getActivity(), ContactServiceActivity.class);
			startActivity(intent);
			break;
		case R.id.lay_name:
			intent = new Intent(getActivity(), PersonInfoActivity.class);
			startActivity(intent);
			break;
		case R.id.lay_suggest:
			intent = new Intent(getActivity(), SuggestActivity.class);
			startActivity(intent);
			break;
		default:
			break;
		}
	}
}